<?php defined('SYSPATH') or die('No direct script access.');
$mydatetime	= Helper_MyDateTime::factory();
$arraylist	= Helper_ArrayList::factory();
$display		= Helper_DisplayItems::factory();
$thesystems		= Helper_thesystems::factory();

$r = Request::current();
$action = $r->uri2();
$mode = Arr::get($_REQUEST,'mode');
?>
<?php if($mode != 'print') { ?>
<?php 
	echo View::factory('module/apps_breadcrumb')
		->set('breadcrumbs',
			array(
				0=>array(
					'address'=>'index',
					'text'=>'Dashboard'
				),
				1=>array(
					'address'=>NULL,
					'text'=>"Report User's"
				)
			)
		)
		->render();
?>

<?php echo View::factory('module/apps_message')->render(); ?>
<?php } ?>
<!-- User Table Starts -->
<div class="row centered-margin">		
	<div class="box">
		<div class="box-content">
			<table class="table table-bordered table-striped table-condensed table-hover">
			  <thead>
				  <tr>
					  <th width="250">Full Name</th>
					  <th width="150">Username</th>
					  <th width="130">Level</th>
					  <th width="286" class="hidden-tablet hidden-phone">Email</th>                                           
				  </tr>
			  </thead>   
			  <tbody>
				<?php if(empty($userlists)) { ?>
				  <tr valign="middle">
				    <td colspan="6" valign="middle" style="text-align: center;"><strong>There is no data</strong></td>
				  </tr>
				<?php } else { ?>
				  <?php foreach($userlists as $userlist) { ?>
					<tr>
						<td><?php echo $userlist['fullname'] ?></td>
						<td><?php echo $userlist['nickname'] ?></td>
						<td><?php echo $display->privilege_value($userlist['userroles_key']) ?></td>
						<td class="hidden-tablet hidden-phone"><?php echo $userlist['email'] ?></td>
					</tr>
				  <?php } ?>
				<?php } ?>
			  </tbody>
			</table>
			<?php if($mode != 'print') { ?>
			<a href="<?php echo 'reportusers'.URL::query(array('mode'=>'print')) ?>" target="_new" title="Print"><?php echo HTML::image('assets/global/images/print.png')?></a>
			<?php } ?>
		</div>
	</div>
</div>
<!-- User Table End -->
